<?php

/**
 * SmsConfigModel 模型
 * Class SmsConfigModel
 */
class SmsConfigModel extends BaseModel
{

    public $tableName = "sms_config";
    public $errMsg = '';

    static private $_singleton;

    public function __construct()
    {
        parent::__construct($this->tableName);
    }

    static public function getSingleton()
    {
        if (!self::$_singleton) {
            self::$_singleton = new static();
        }

        return self::$_singleton;
    }

    static public function getConfByIndex( $index ){
        $selfModel = static::getSingleton();
        $res = $selfModel->find(['name'=> $index]);
        return $res;
    }

}